<?php
namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Lib\Response;
use App\Http\Model\Hint;
use App\Http\Services\GiftServices;

class ApiGiftController extends BaseController
{
    protected $giftService;

    public function __construct(){
        $this->giftService = new GiftServices();
    }

    /**
     * 用户收到的礼物列表
     */
    public function userReceiveGiftList(Request $request)
    {
        $userId = (int) $request->input('user_id');
        if(empty($userId)) {
            Response::returnResult(Hint::PARAM_ERROR);
        }
        $showType = (int) $request->input("show_type", 0);
        $limit = (int) $request->input('page_size', 10);
        $page = (int) $request->input('page_index', 0);

        $data = $this->giftService->userReceiveGiftList($userId, $showType, $limit, $page);

        Response::returnResult(Hint::SUCCESS, $data);
    }





}
